package com.test.servicetest;

import com.alibaba.fastjson.JSON;
import com.bosssoft.itfinance.citizen.demo.biz.entity.Permission;
import com.bosssoft.itfinance.citizen.demo.biz.service.IPermissionService;
import com.test.common.BaseTest;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * Created by wangml on 2017/8/29.
 * 对于mybatis plus自带的方法不能满足要求时，可以自定义扩展，手写SQL
 * 比如：多表关联查询，单表镶嵌查询，镶嵌结果更新语句
 */

public class SpecifyDemo extends BaseTest{
    private static final Logger logger = LoggerFactory.getLogger(DailyDemo.class);

    @Autowired
    private IPermissionService permissionService;

    /**
     * 查询用户菜单权限
     * @throws Exception
     */
    @Test
    public void queryMenuByUser() throws Exception {
        Set<String> states = new HashSet<>();
        states.add("1");
        states.add("2");
        List<Permission> list = permissionService.queryMenuByUser("1",states);
        logger.error("========="+ JSON.toJSON(list));
    }
}
